package com.bwie.controller;
import com.bwie.pojo.User;
import com.bwie.service.Impl.UserServiceImpl;
import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginFromVo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* (t_user)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/user/user")
public class UserController {
/**
* 服务对象
*/
    @Autowired
    private UserService userService;

    /**
     * 用户/邮箱登录
     * @param loginFromVo
     * @return
     */
    @PostMapping(value = "/login")
    public R login(
            @RequestBody @Validated LoginFromVo loginFromVo
            ){
        return userService.login(loginFromVo);
    }
}
